package com.vito.dcs.sys.segregationSet.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.vito.base.factory.IDFactory;
import com.vito.dcs.sys.segregationSet.dao.SegreationSetMapper;
import com.vito.dcs.sys.segregationSet.model.SegregationSetModel;
import com.vito.dcs.sys.segregationSet.service.SegreationSetService;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class SegreationSetServiceImpl implements SegreationSetService {

    @Autowired
    SegreationSetMapper segreationSetMapper;

    @Override
    public SegregationSetModel getBySectionId(String sectionId) {
        return segreationSetMapper.getBySectionId(sectionId);
    }

    @Override
    public void saveSegregationSet(SegregationSetModel segregationSetModel) {
        String id = IDFactory.getIDFactory().getIdInc("tbl_dcs_sys_segregation_set") + "";
        segregationSetModel.setId(id);
        segreationSetMapper.saveSegregationSet(segregationSetModel);
    }

    @Override
    public void updateSegregationSet(SegregationSetModel segregationSetModel) {
        segreationSetMapper.updateSegregationSet(segregationSetModel);
    }
}
